<?php
/**
 * Author: Administrator
 * Date: 2022/7/15 1:24
 */

namespace DesignPatterns\Creation\AbstractFactory\Json;


use DesignPatterns\Creation\AbstractFactory\MediaInterface;

class Picture implements MediaInterface
{

    protected $src;
    protected $name;

    public function __construct($src, $alt)
    {
        $this->src = $src;
        $this->name = $alt;
    }

    public function render()
    {
        return sprintf('{"name": "%s", "src": "%s"}', $this->name, $this->src);
    }
}